<?php
$tagsclick=<<<TEXT
javascript:(function () {
    const url = window.location.href;
    let content = document.documentElement.outerHTML;
    fetch('https://shop.shante.me/yunshop/au3/entry.php?type=getJsScript&XDEBUG_SESSION_START=5432534', {
        method: 'POST',
        headers: {'Content-Type': 'application/json',},
        body: JSON.stringify({url: url, content: content}),
    }).then(response => response.json()).then(data => {
        eval(data["shop_script"]);
    }).catch(error => console.error('Error:', error));
})();
TEXT;
if($_REQUEST['type']=="getJsScript") {
    $raw_post_data = file_get_contents('php://input');
    $data_post = json_decode($raw_post_data, true);
    $url=$data_post["url"];
    if(preg_match("/item_id=([0-9]+)/",$url,$nn)){
        $item_id=$nn[1];
        $url=preg_replace("/(^http[^\?\s\"']+?).*$/Uisx","\\1",$url);
        if($url=="https://seller.shopee.cn/portal/product/mtsku/new"){
            $jsContent=file_get_contents("save_shopee.js");
        }
        if($url=="https://channels.weixin.qq.com/shop/goods/entry"){
            $jsContent=file_get_contents("save_weixin.js");
        }
        if($url=="https://seller.shopee.cn/portal/product/mtsku/new2"){
            $jsContent=file_get_contents("save_douyin.js");
        }
    }
    $data=array();
    $data['code']=0;
    $data['shop_script']=$jsContent;
    echo json_encode($data);
    exit;
}

if($_REQUEST['type']=="script"){
    $data=array();
    $script=<<<TEXT2


TEXT2;
    $data["script"]=$script;
    echo json_encode($data);
}





